package ldh.im.base.message;

public enum MessageRole {
    User(0),
    Manager(1),
    Monitor(2),
    ;

    private int value;

    private MessageRole(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    public static MessageRole getByValue(int value) {
        for(MessageRole messageRole : MessageRole.values()) {
            if (messageRole.getValue() == value) {
                return messageRole;
            }
        }
        throw new RuntimeException(String.format("MessageRole value(%s) is error!", value));
    }

}
